***Open African Solutions.dta***

*table 1*
*(1)*
logit agreement i.african i.nonafrican i.warsupport intensity duration i.territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
outreg2 using reg.doc, append ctitle(Model 1)
margins african nonafrican
margins, dydx(*) post
estimates store A
*(2)*
logit agreementterm i.african i.nonafrican i.warsupport intensity duration i.territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
outreg2 using reg.doc, append ctitle(Model 2)
margins african nonafrican
margins, dydx(*) post
estimates store B
coefplot A B, drop(_cons _spline1 _spline2 _spline3) xline(0) xtitle(Average marginal effects)
graph save Graph1
*(3)*
logit agreement i.african i.nonafrican i.panafrican_gov i.panafrican_reb i.panafrican_gov##i.african i.panafrican_reb##i.african i.panafrican_gov##i.nonafrican i.panafrican_reb##i.nonafrican i.warsupport intensity duration i.territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
outreg2 using reg.doc, append ctitle(Model 3)
margins panafrican_gov, dydx(african nonafrican) pwcompare
margins, dydx(african nonafrican) at(panafrican_gov=(0(1)1))
marginsplot
graph save Graph3
margins panafrican_reb, dydx(african nonafrican) pwcompare
margins, dydx(african nonafrican) at(panafrican_reb=(0(1)1))
marginsplot
graph save Graph4
graph combine Graph3.gph Graph4.gph
margins african nonafrican, at(panafrican_gov=(0(1)1)) 
margins african nonafrican, at(panafrican_reb=(0(1)1))
logit agreement i.african i.nonafrican i.panafrican_gov i.panafrican_reb i.panafrican_gov##i.african i.panafrican_reb##i.african i.panafrican_gov##i.nonafrican i.panafrican_reb##i.nonafrican i.warsupport intensity duration i.territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
*(4)*
logit agreement i.africanonly i.nonafricanonly i.mixed i.warsupport intensity duration i.territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
outreg2 using reg.doc, append ctitle(Model 4)
margins africanonly nonafricanonly mixed
margins, dydx(*) post
estimates store C
*(5)*
logit agreement i.africanonly i.mixed i.warsupport intensity duration i.territory peaceyrs _spline1 _spline2 _spline3 if mediation == 1, vce (cluster conflict_id)
outreg2 using reg.doc, append ctitle(Model 5)
margins africanonly mixed
margins, dydx(*) post
estimates store D
coefplot C D, drop(_cons _spline1 _spline2 _spline3) xline(0) xtitle(Average maginal effects)
graph save Graph2
graph combine Graph1.gph Graph2.gph

*table 2*
*(6)*
logit agreement african nonafrican sharedculture africanmanipulation nonafricanmanipulation africanbiased nonafricanbiased warsupport intensity duration territory  peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
outreg2 using reg.doc, append ctitle(Model 6)
*robustness check - other types of third parties*
logit agreement african nonafrican sharedculture manipulation biased warsupport intensity duration territory  peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
logit agreement african nonafrican sharedculture africanmanipulation nonafricanmanipulation africanbiased nonafricanbiased majorpower neighbour warsupport intensity duration territory  peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
logit agreement african nonafrican sharedculture warsupport intensity duration territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
logit agreement african nonafrican manipulation warsupport intensity duration territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
logit agreement african nonafrican africanmanipulation nonafricanmanipulation warsupport intensity duration territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
logit agreement african nonafrican biased warsupport intensity duration territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
logit agreement african nonafrican africanbiased nonafricanbiased warsupport intensity duration territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
logit agreement african nonafrican majorpower warsupport intensity duration territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
logit agreement african nonafrican neighbour warsupport intensity duration territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)

*table 3*
*(7)*
regress nonafrican elections warsupport intensity duration territory
outreg2 using reg.doc, append ctitle(Model 7)
*(8)*
regress agreement african nonafrican elections warsupport intensity duration territory, vce (cluster conflict_id)
outreg2 using reg.doc, append ctitle(Model 8)
*(9)*
ivregress 2sls agreement (nonafrican = elections) african warsupport intensity duration territory, vce (cluster conflict_id) first
estat endogenous
estat firststage, all forcenonrobust
outreg2 using reg.doc, append ctitle(Model 9)

***Open Mediation in Non-African Conflicts***

*extended analysis*
drop if europe ==1
drop if asia ==1
btscs agreement year dyad_id, g(peaceyrs) nspline(3)
logit agreement regional nonregional warsupport intensity duration territory peaceyrs _spline1 _spline2 _spline3, vce (cluster conflict_id)
outreg2 using reg.doc, append ctitle(Model 1)
